package com.homework2;

import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;

public class Test06 {
    public static void main(String[] args) {
        HashSet<Integer> hashSet = new HashSet<>();
        int size = hashSet.size();
//        System.out.println(size);
//        System.out.println(randomI);
        while (size<=10){
            Random random = new Random();
            int randomI = random.nextInt(20)+1;
            Collections.addAll(hashSet,randomI);
            size++;
        }
        Iterator<Integer> iterator = hashSet.iterator();
        while (iterator.hasNext()){
            Integer next = iterator.next();
            System.out.print(next+" ");
        }
    }
}
